<template>
  <div>
    <aplid-base-crud ref="crud" class="w-100" v-bind="{ ...theConfig, ...$attrs }" :paramsObj="{...params}">

    </aplid-base-crud>
  </div>
</template>
<script setup lang="ts">
import { baseConfig } from './config'
import { editConfig } from '@/views/datacenter/comprehensiveQueries/utils/index'
type Props = {
  ifShowSearch?:any
  isWithAuth?:any
  isComprehensiveQueries?: boolean
}
const props = withDefaults(defineProps<Props>(), {
  ifShowSearch:true,
  isWithAuth:undefined,
  isComprehensiveQueries: false
})
let params = reactive({
  code:3020,
  isWithAuth:props.isWithAuth
})

let theConfig: any = ref({})

if (baseConfig) {
	let defaultConfig = JSON.parse(JSON.stringify(baseConfig))
	if (props.isComprehensiveQueries) {
		theConfig.value = editConfig(defaultConfig)
	} else {
		if (props.ifShowSearch) {
			theConfig.value = baseConfig
		} else {
			defaultConfig.searchConfig = undefined
			defaultConfig.auth.import = undefined
			defaultConfig.auth.mulitSet = undefined
			theConfig.value = defaultConfig
		}
	}
}
</script>
<style scoped lang="scss"></style>